<dl class="dl-horizontal left">
  <dt><!--Status:-->{{'Status'| translate}}</dt>
  <dd>
    <status-icon status="deployment | deploymentStatus"></status-icon>
    {{deployment | deploymentStatus}}
    <span style="margin-left: 7px;">
      <button ng-show="!rollBackCollapsed && (deployment | deploymentStatus) == 'Complete' && !(deployment | deploymentIsLatest : deploymentConfig) && !deployment.metadata.deletionTimestamp" ng-disabled="(deploymentConfigDeploymentsInProgress[deploymentConfigName] | hashSize) > 0" type="button" class="btn btn-default btn-xs" ng-click="rollBackCollapsed = !rollBackCollapsed">Roll Back</button>
      <div ng-show="rollBackCollapsed" class="well well-sm">
        Use the following settings from {{deployment.metadata.name}} when rolling back:
        <div class="checkbox">
          <label>
            <input type="checkbox" ng-model="changeScaleSettings" ng-disabled="(deploymentConfigDeploymentsInProgress[deploymentConfigName] | hashSize) > 0"> replica count and selector
          </label>
        </div>
        <div class="checkbox">
          <label>
            <input type="checkbox" ng-model="changeStrategy" ng-disabled="(deploymentConfigDeploymentsInProgress[deploymentConfigName] | hashSize) > 0"> deployment strategy
          </label>
        </div>
        <div class="checkbox">
          <label>
            <input type="checkbox" ng-model="changeTriggers" ng-disabled="(deploymentConfigDeploymentsInProgress[deploymentConfigName] | hashSize) > 0"> deployment trigger
          </label>
        </div>
        <button type="button" ng-click="rollbackToDeployment(deployment, changeScaleSettings, changeStrategy, changeTriggers)" ng-disabled="(deploymentConfigDeploymentsInProgress[deploymentConfigName] | hashSize) > 0" class="btn btn-default btn-xs">Roll Back</button>
      </div>
      <!-- disabled until we have an api endpoint for retry
      <button ng-show="(deployment | deploymentStatus) == 'Failed'" type="button" ng-click="retryFailedDeployment(deployment)" ng-disabled="(deploymentConfigDeploymentsInProgress[deploymentConfigName] | hashSize) > 0" class="btn btn-default btn-xs" ng-if="(deployment | deploymentIsLatest : deploymentConfig) && !deployment.metadata.deletionTimestamp">Retry</button>
      -->
      <button ng-show="(deployment | deploymentIsInProgress) && !deployment.metadata.deletionTimestamp" type="button" ng-click="cancelRunningDeployment(deployment)" class="btn btn-default btn-xs">Cancel</button>
    </span>
  </dd>
  <dt ng-if-start="deployment | isDeployment"><!--Deployment config:-->{{'Deploymentconfig'| translate}}</dt>
  <dd ng-if-end>
    <a href="{{deploymentConfigName | navigateResourceURL : 'DeploymentConfig' : deployment.metadata.namespace}}">{{deploymentConfigName}}</a>
  </dd>
  <dt ng-if-start="deployment | annotation:'deploymentStatusReason'">Status reason:</dt>
  <dd ng-if-end>
    {{deployment | annotation:'deploymentStatusReason'}}
  </dd>
  <dt ng-if-start="deployment | deploymentIsInProgress">Duration:</dt>
  <dd ng-if-end>
    <span ng-switch="deployment | deploymentStatus" class="hide-ng-leave">
      <span ng-switch-when="Running">running for <duration-until-now timestamp="deployment.metadata.creationTimestamp"></duration-until-now></span>
      <span ng-switch-default>waiting for <duration-until-now timestamp="deployment.metadata.creationTimestamp"></duration-until-now></span>
    </span>
  </dd>
  <dt><!--Selectors:-->{{'Selectors'| translate}}</dt>
  <dd>
    <span ng-if="!deployment.spec.selector">none</span>
    <span ng-repeat="(labelKey, labelValue) in deployment.spec.selector">{{labelKey}}={{labelValue}}<span ng-show="!$last">, </span></span>
  </dd>
  <dt><!--Replicas:-->{{'Replicas' | translate}}</dt>
  <dd>
    <!-- Enable scaling if this is a plain replication controller or it's the active deployment. -->
    <replicas status="deployment.status.replicas"
              spec="deployment.spec.replicas"
              disable-scaling="(deployment | isDeployment) && !deploymentConfigMissing && (!isActive || !deploymentConfig)"
              scale-fn="scale(replicas)">
    </replicas>
  </dd>
  <annotations annotations="deployment.metadata.annotations"></annotations>
</dl>
<div class="deployment-detail">
  <span>Pod <!--template:-->{{'template' | translate}}</span>
  <pod-template
    pod-template="deployment.spec.template"
    images-by-docker-reference="imagesByDockerReference"
    builds="builds"
    detailed="true"></pod-template>
    <h4 style="margin-top: 20px;"><!--Volumes-->{{'Volumes' | translate}}</h4>
    <a ng-href="project/{{project.metadata.name}}/attach-pvc?deployment={{deployment.metadata.name}}"><!--Attach storage-->{{'Attachstorage'| translate}}</a>
    <volumes volumes="deployment.spec.template.spec.volumes" namespace="project.metadata.name"></volumes>
</div>
